{extend name="base" /}
{block name="title"}{$userInfo['nickname']}-隐私设置|程序员的收藏夹-专注于程序员学习、分享{/block}

{block name="style"}
<style type="text/css">
	.box-title.icon::before{
		color: #4a4a4a;
	}
</style>
{/block}

{block name="header"}
	{include file="public/user_header" /}
{/block}

{block name="content"}
<div class="zbd-content">
	<div class="page">
		<div class="user-home">
			<div class="home-menu left yy">
				{include file="public/user_left_nav" /}
			</div>
			<div class="home-body right">
				<div class="row">
					<div class="w12">
						<div class="box yy">
							<div class="box-title icon icon ice-switch-on">
								<div class="left bold">隐私设置</div>
								<!-- <a href="javascript:history.go(-1);" class="right cursor-pointer"><div class="ice-revoke-left black"><span class="small"> 返回</span></div></a> -->
							</div>
							<div class="box-content">
								<div class="privacy">
									<div class="privacy-item">
										<div class="zbs-yinsi-title">
											<div class="title-l bold">教育信息</div>
											<div class="doc-intro">开启后在个人主页等模块向他人展示教育信息：学校名称、专业名称、入学时间、学历</div>
										</div>
										<div class="toggle-text zbs-yinsi">
										    <input type="checkbox" class="JS-save" id="is_jiaoyu" data-name="is_jiaoyu" value="{$userInfo['is_jiaoyu']}" {if condition="$userInfo['is_jiaoyu'] == 1"}checked{/if}>
										    <label for="is_jiaoyu"><span>开启</span><span>关闭</span></label>
										</div>
									</div>

									<div class="privacy-item">
										<div class="zbs-yinsi-title">
											<div class="title-l bold">基础信息</div>
											<div class="doc-intro">开启后在个人主页等模块向他人展示基础信息：用户性别、所在地区</div>
										</div>
										<div class="toggle-text zbs-yinsi">
										    <input type="checkbox" class="JS-save"  id="is_jichu" data-name="is_jichu" value="{$userInfo['is_jiaoyu']}" {if condition="$userInfo['is_jichu'] == 1"}checked{/if}>
										    <label for="is_jichu"><span>开启</span><span>关闭</span></label>
										</div>
									</div>

									<div class="privacy-item">
										<div class="zbs-yinsi-title">
											<div class="title-l bold">我的关注列表</div>
											<div class="doc-intro">开启后在个人主页等模块向他人展示我关注的用户列表</div>
										</div>
										<div class="toggle-text zbs-yinsi">
										    <input type="checkbox" class="JS-save"  id="is_guanzhu" data-name="is_guanzhu" value="{$userInfo['is_guanzhu']}" {if condition="$userInfo['is_guanzhu'] == 1"}checked{/if}>
										    <label for="is_guanzhu"><span>开启</span><span>关闭</span></label>
										</div>
									</div>

									<div class="privacy-item">
										<div class="zbs-yinsi-title">
											<div class="title-l bold">我的粉丝列表</div>
											<div class="doc-intro">开启后在个人主页等模块向他人我的粉丝列表</div>
										</div>
										<div class="toggle-text zbs-yinsi">
										    <input type="checkbox" class="JS-save"  id="is_fans" data-name="is_fans" value="{$userInfo['is_fans']}" {if condition="$userInfo['is_fans'] == 1"}checked{/if}>
										    <label for="is_fans"><span>开启</span><span>关闭</span></label>
										</div>
									</div>

								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	ice(function(){
		ice(".JS-save").click(function(e) {
			var keyName = ice(this).attr("data-name")

			ice.ajax({
			    url:'/user/privacy',
			    type:'get',
			    data:{key:keyName},
			    success:function(res){
			    	ui.loadClose()
			        if(res.code == 1){
			            ice.pop({content:res.message,icon:'fail'})
			            return false;
			        }else{
			        	ice.pop({content:res.message,icon:'success'})
			        }
			    }
			});
		})
	})
</script>

{/block}